====== Coding Solutions ======

===== Adding a waypoint hyperlink =====

Add the include file:

<code>
#include <wx/hyperlink.h>
</code>

Ensure this define is entered below the includes:

<code>
WX_DEFINE_LIST(Plugin_HyperlinkList);
</code>

Now add the code for making a waypoint with a hyperlink:

<code>
Plugin_Hyperlink* myLink = new Plugin_Hyperlink;
    myLink->DescrText = _("VentureFarther Marker Detail");
    myLink->Link = rte_link;
    myLink->Type = wxEmptyString;

    Plugin_HyperlinkList* myLinkList = new Plugin_HyperlinkList;
    myLinkList->Insert(myLink);

    double myLat, myLon;
    rte_lat.ToDouble(&myLat);
    rte_lon.ToDouble(&myLon);

    PlugIn_Waypoint * pPoint = new PlugIn_Waypoint(myLat, myLon,
        rte_desc, rte_name, "");

    pPoint->m_IconName = rte_sym;
    pPoint->m_MarkDescription = rte_desc;
    pPoint->m_HyperlinkList = myLinkList;

    bool added = AddSingleWaypoint(pPoint, true);
</code>

rte_link is the URL that you want to use for the hyperlink.

{{opencpn:dev:solutions.hyperlink.png?nolink&}}

